The invention relates to imaging, image categorization and image processing in optical code reading devices. Aspects of the invention are particularly useful in image-based, handheld code readers which are positioned at variable orientations and distances with respect to a target code.
Optical codes are patterns made up of image areas having different light reflective or light emissive properties, which are typically assembled in accordance with a priori rules. The term xe2x80x9cbar codexe2x80x9d is sometimes used to describe certain kinds of optical codes. The optical properties and patterns of optical codes are selected to distinguish them in appearance from the background environments in which they are used. Devices for identifying or extracting data from optical codes are sometimes referred to as xe2x80x9coptical codexe2x80x9d readers, of which bar code scanners are one type.
Optical code readers are used in both fixed or portable installations in many diverse environments such as in stores for check-out services, in manufacturing locations for work flow and inventory control and in transport vehicles for tracking package handling. The optical code can be used as a rapid, generalized means of data entry, for example, by reading a target code from a printed listing of many codes. In some uses, the optical code reader is connected to a portable data processing device or a data collection and transmission device. Frequently, the optical code reader includes a handheld sensor which is manually directed at a target code.
Most conventional optical scanning systems are designed to read one-dimensional bar code symbols, such as the ubiquitous UPC code. Typically, bar codes include a pattern of variable-width rectangular bars separated by fixed or variable width spaces. The bars and spaces have different light reflecting characteristics. One example of a one dimensional bar code is the UPC/EAN code used to identify, for example, product inventory. An example of a two-dimensional or stacked bar code is the PDF417 bar code. A description of PDF417 bar code and techniques for decoding it are disclosed in U.S. Pat. No. 5,635,697 to Shellhammer et al and assigned to Symbol Technologies, Inc., which patent is incorporated herein by reference. Another conventional optical code is known as xe2x80x9cMaxiCodexe2x80x9d. It consists of a central finder pattern or bull""s eye center and a grid of hexagons surrounding the central finder. It should be noted that the aspects of the inventions disclosed in this patent application are applicable to optical code readers, in general, without regard to the particular type of code or codes which they are adapted to read. In fact, the present invention is specifically adapted to operate as an omnicode reader, i.e., able to read many different types of codes. The invention described may also be applicable to some associated image recognition or analysis.
Most conventional scanning systems generate one or more beams of laser light which reflects off a bar code symbol and back to the scanning system. The system obtains a continuous analog waveform corresponding to the light reflected by the code along one or more scan lines of the system. The system then decodes the waveform to extract information from the bar code. A system of this general type is disclosed, for example, in U.S. Pat. No. 4,251,798, assigned to Symbol Technologies, Inc. A beam scanning system for detecting and decoding one and two dimensional bar codes is disclosed in U.S. Pat. No. 5,561,283, also assigned to Symbol Technologies, Inc.
Bar codes can also be read employing imaging devices. For example an image sensor may be employed which has a two dimensional array of cells or photo sensors which correspond to image elements or pixels in a field of view of the device. Such an image sensor may be a two dimensional or area charge coupled device (CCD) and associated circuits for producing electrical signals corresponding to a two-dimensional array of pixel information for a field of view. The pixel information generated by the CCD can, after digitization, be stored in a memory device for subsequent image processing which is used to locate and decode the codes which have been electronically captured by the CCD.
U.S. Pat. No. 5,268,580 to Duanfeng He (one of the Applicants of the present invention) describes a known imaging device that is used to read bar codes. This patent describes a technique for evaluating the pixel information stored in the memory device to determine bar edges as part of the process of locating a bar code. However, the device described in the He patent is limited to use in reading one particular type of optical code, i.e., bar codes. As described above, today there are many different types of codes available, many of which may be unreadable using the imaging device described in the He patent.
Accordingly, it is an object of the present invention to provide apparatuses and methods which can be used to efficiently decode many different types of codes, preferably independently of user interaction, which types of devices and methods are referred to herein by the word xe2x80x9comnicodexe2x80x9d.
Some omnicode devices have already been designed to read different types of codes. These conventional omnicode readers may use an unsophisticated, trial and error approach to decipher the information provided in the scanned codes. For example, these devices may sample the image in one or more directions, e.g., by drawing lines across the image to identify dimensional values, and then attempt to decode the sampled information in a variety of ways until an intelligible pattern match is achieved. Thus, this approach might first evaluate a sample as a bar code, then as a two-dimensional PDF code, then as a MaxiCode, and so on until the code is successfully decoded. However, this approach is very processing power intensive and becomes more and more inefficient as the number of different types of codes increases.
Accordingly, it is another object of the invention to avoid trial and error approaches to decoding by identifying the code type before decoding.
As mentioned above, one of the tasks involved in reading an optical code involves sampling the code to determine dimensional values of the code elements. For example, a one-dimensional bar code can be decoded by determining the widths of the code elements (i.e, bars and/or spaces) and matching those values against predetermined patterns. In a conventional laser scanning device, the samples were taken directly by sweeping a beam across the code to obtain a sample line across all of the code elements. These samples could then be used to determine the needed dimensional values and decode the bar code. The scanning line of the device was visible to the user so that it could be properly directed depending upon the orientation of the bar code being scanned.
In imaging devices, however, information is obtained for a two dimensional area defined by the field of view of the device. One or more codes of the same or different types may be disposed in this area. The orientation of the code or codes may be arbitrary relative to the field of view. The field of view may also include environmental background and regions which are devoid of optical codes. The resultant digitized information is available in memory as, for example, gray scale pixel values and the image processing circuitry and/or software must determine which pixels values should be evaluated to read the optical code. This selection or sampling process is referred to herein as xe2x80x9cline drawingxe2x80x9d, since it involves the selection of pixels relative to an ideal scanning line whose values are checked to determine code element dimensions.
Accordingly, it is another object of the invention to provide appropriate line drawing techniques to sample the pixel values in memory which take into account the arbitrary nature of the type of code being read and its orientation.
The present disclosure relates to methods and apparatus useful in optical code readers, especially imaging optical code readers. Techniques are disclosed which are applicable to the signal processing techniques that are used to transform the sensed optical patterns into the values associated with the optical code. Different types of optical codes (e.g., bar codes, two-dimensional codes, MaxiCodes, etc.) can all be decoded using techniques according to the present invention.
An imaging and aiming apparatus for an optical code reader may be based on an image sensor, including an array of photo sensor cells for producing electronic signals corresponding to a two-dimensional array of pixel information for a field of view. This pixel information is stored in a memory device, e.g., a random access memory (RAM) for subsequent image analysis processing. According to one exemplary embodiment, the pixel information is first evaluated by an auto-discrimination function which identifies each optical code in the field of view by its type and orientation. Depending upon the type of code identified by the auto-discrimination function, certain information is then passed to an appropriate decoding function to determine the values associated with the identified optical code.
According to one exemplary embodiment, surface tangent vectors are computed for all, or some, of the pixels, which tangents can also be stored in memory. These vectors provide information relating to the contours and orientations of the code elements. The surface tangent information can be processed in chunks referred to herein as subimages, for example, 32xc3x9732 pixel subimages. Within each subimage the surface tangent vectors can be analyzed to generate tangent statistics for that subimage. Then, subimages which have common tangent statistics can be grouped together to determine general boundaries associated with a cluster, i.e., a potential optical code.
The tangent statistics can also be used to identify the code type associated with a cluster. For example, if the tangent statistics for a cluster reveal one predominant orientation, then the code is most likely to be a one-dimensional code. Alternatively, if the tangent statistics reveal two major tangent vector orientations, then the code is most likely to be a two-dimensional code. Clusters having a greater distribution of tangent orientations can be classified as other types of codes, e.g, MaxiCodes.
Other types of statistics can be generated using the stored pixel data for use in identifying optical code types. For example, a black level, a white level and a threshold level can be computed for each subimage. These statistics can be used in conjunction with, or as opposed to, surface tangent statistics to discriminate between optical code types.
Once an optical code type has been identified by the auto-discrimination function, information is passed to an appropriate decoding function, which information can include a direction of orientation of the optical code, coordinates associated with a cluster, etc. The decoding function can use this information to sample pixel data in memory in order to obtain information for decoding. The selection of specific pixels as samples, referred to herein as line drawing, can be made in different ways depending upon the orientation of the code relative to the elements in the image sensing array.